home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15904 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: news.sprintlink.net!datalytics!usenet
  2. From: Rob Stewart <stew@datalytics.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: What are the differences between structures and classes in C++ ?
  5. Date: Mon, 08 Apr 1996 15:39:58 -0400
  6. Organization: Datalytics, Inc
  7. Message-ID: <31696B8E.6461@datalytics.com>
  8. References: <4k5m65$av@hpscit.sc.hp.com> <DpG53J.Hsz@presby.edu> <4k83j3$a56@hpscit.sc.hp.com> <marnoldDpHvED.E0t@netcom.com>
  9. NNTP-Posting-Host: 204.62.224.71
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (WinNT; I)
  14.  
  15. Matt Arnold wrote:
  16. > Raghuveera Ravinutala <raghur> writes:
  17. > ><jtbell@presby.edu (Jon Bell)> wrote :
  18. > >>the only *formal* difference between a class and a
  19. > >>struct is that by default, class members are private whereas struct
  20. > >>members are public.
  21. > >Thanx. I am aware of this difference. I would like to know more, like,
  22. > >inheritence etc..
  23. > There is none, other the default protection state of members.  [snip]
  24. > Structs can inherit from other structs and classes and can be inherited
  25. > by other structs and classes.  Structs can have virtual functions, member
  26. > operators, constructors and destructors, you can create template structs,
  27. > and so on.
  28. > In other words, structs *are* classes.
  29.  
  30. Actually, classes *are* structs, since struct came first.  Early 
  31. debuggers would also reveal this (at least dbx on the UNIX side 
  32. did).  What you declared a class the debugger revealed as a 
  33. struct.
  34.  
  35. -- 
  36. Robert Stewart        | My opinions are usually my own.
  37. Datalytics, Inc.    | stew@datalytics.com
  38.